package com.zhku.orders.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhku.orders.model.dto.HotGoodsDto;
import com.zhku.orders.model.po.TtOrdersGoods;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author itcast
 */
public interface TtOrdersGoodsMapper extends BaseMapper<TtOrdersGoods> {


    @Select("SELECT goods_id, COUNT(*) as cnt FROM tt_orders_goods GROUP BY goods_id ORDER BY cnt DESC LIMIT 10")
    List<HotGoodsDto> getHotGoodsList();
}
